package com.agile.leetcode.stack;

/**
 * @Author ChenZhangKun
 * @Date 2020/11/2 10:26
 */
public class StackMethod {
    public static void main(String[] args) {
        Method method=new Method();
        method.fun();
    }
}
class Method{
    public void fun(){
        // 当前方法的堆栈信息
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        for (StackTraceElement stackTraceElement : stackTrace) {
            System.out.println(stackTraceElement.getMethodName());
        }
    }
}
